function drop_cart_item(store_id, rec_id){
    var tr = $('#cart_item_' + rec_id);
    var amount_span = $('#cart'+store_id+'_amount');
    $.getJSON('index.php?act=cart&op=drop&d=m&specid=' + rec_id + '&storeid=' + store_id, function(result){
        if(result.done){
            //删除成功
            if(result.quantity == 0){//判断进货车是否为空
                window.location.reload();    //刷新
            }
            else{
                //如果是商品商城
                if(store_id){
                    //判断商城商品是否为空
                    if(result.store_quantity == 0){
                        $(".storemodule_"+store_id).remove();
                    }
					tr.remove();        //移除
					amount_span.html(price_format(result.store_amount));  //刷新总费用
                }else{
                    //判断商城商品是否为空
                    if(result.store_quantity == 0){
                        $(".storemodule_"+store_id).remove();
                    }
					//如果没有商城,那么为试用妆
					$('.store_data_list_0').html(result.htmldata);
					amount_span.html(number_format((9+(parseInt(result.store_quantity)-1)*3), 2));  //刷新总费用
                }
            }
        }else{
        	alert(result.msg);
        }
    });
}

function change_quantity(store_id, rec_id, spec_id, input, orig){
    var amount_span = $('#cart' + store_id + '_amount');
    //暂存为局部变量，否则如果用户输入过快有可能造成前后值不一致的问题
    var _v = input.value;
    $.getJSON('index.php?act=cart&op=update&spec_id=' + spec_id + '&quantity=' + _v, function(result){
        if(result.done){
            //更新成功
            $(input).attr('changed', _v);
            amount_span.html(number_format(result.amount,2));
        }
        else{
            //更新失败
			endTime = new Date().getTime() / 1000 + 3;
			iconShow(result.msg);
            $(input).val($(input).attr('changed'));
        }
    });
}